<script type="text/javascript" src='{$base_dir}modules/dept_laboratory/js/AJAX_LabResult.js'></script>
<script src="{$base_dir}js/jquery.tablesorter.min.js" type="text/javascript" ></script>
<script src="{$base_dir}js/jquery.tablesorter.pager.js" type="text/javascript" ></script>
<script src='{$base_dir}js/jquery.contextmenu.r2.packed.js' type="text/javascript" ></script>

<script type="text/javascript">
{literal}   
    $(document).ready(function () {
    	{/literal}
        	ticketId = $('#ticketId4Lab').val();
    	    renderSelector4ViewOnly(ticketId,'{$selectedlabAssignmentTicketId}','{$selectedLabTicketId}');
        {literal}

        $("#labResultPrint").bind('click', function() {
            var selectedlabAssignmentTicketId = $('select#labAssignmentTicketList :selected').val();
            var selectedLabTicketId = $('select#labTicketList :selected').val();
            
            if (selectedlabAssignmentTicketId != null && $.trim(selectedlabAssignmentTicketId) != ''
                && selectedLabTicketId != null && $.trim(selectedLabTicketId) != '') {            
            	   printLabResult(selectedlabAssignmentTicketId, selectedLabTicketId);
            }
        });
        
    });
{/literal}
</script>

<div id="LabResult">
	<table cellspacing='0' cellpadding='0' style="width: 100%; margin-top: 10px;">
		<tr>
			<td valign='top' style="width: 180px;">
		  		<div id="labResultSelection">
		      		<select style="width: 100%; margin-bottom: 5px;" id="labAssignmentTicketList" ></select>
		  
          			<div id="labTicketListSelect">
			  			<select style="width: 100%;" size="10"  id="labTicketList" >        
			  			</select>
		  			</div>
		  		</div>
	    	</td>
			<td valign='top' style='padding-left: 5px;'>
				<div id="labResultMeta">
		        	<table cellspacing="0" cellpadding="0" class="grid" id="tableLabResultMeta" style='width: 100%'>
						<caption>{$labTicketName}&nbsp;</caption>
					    <tbody>
					        <tr>
					            <td class="form_label">{translate}Treatment doctor{/translate}</td>
					            <td class="form_input"><span>&nbsp;</span></td>
					            <td class="form_label">{translate}Modified{/translate}</td>
					            <td class="form_input"><span>&nbsp;</span></td>
					        </tr>
					        <tr>
					            <td class="form_label">{translate p1=1}Dr/Technician %s{/translate}</td>
					            <td class="form_input">&nbsp;</td>
					            <td class="form_label">{translate}Place{/translate}</td>
					            <td class="form_input">&nbsp;</td>
					        </tr>
					        <tr>
					            <td class="form_label">{translate p1=2}Dr/Technician %s{/translate}</td>
					            <td class="form_input">&nbsp;</td>
					            <td class="form_label">{translate}Machine{/translate}</td>
					            <td class="form_input">&nbsp;</td>
					        </tr>
					        <tr class="last">
					            <td class="form_label">{translate}Diagnosis{/translate}</td>
					            <td class="form_input"><span>&nbsp;</span></td>
					            <td class="form_label">{translate}Sample{/translate}</td>
					            <td class="form_input">&nbsp;</td>
					        </tr>
					    </tbody>
					</table>
				</div>
			</td>	
		</tr>
	</table>
	
	<div class="lab_grid" style='margin-top: 10px;'>
		<div class="h_div">
			<table cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<th style="width: 200px;">{translate}Element{/translate}</th>
						<th style="width: 100px;">{translate}Result{/translate}</th>
						<th style="width: 65px;">{translate}Unit{/translate}</th>
						<th style="width: 120px;">{translate}Normal(M){/translate}</th>
						<th style="width: 120px;">{translate}Normal(F){/translate}</th>
					</tr>
				</thead>
			</table>
		</div>
		
		<div id="labResultContent">
			<div style="height: 250px;" class="b_div"></div>
		</div>
	</div>

	<div style="margin-top: 10px; text-align: right;">
		<span id='statusMessage'></span>                
		<button id="labResultPrint" style="margin-left: 10px;" >{translate}Print{/translate}</button>                                
	</div> 
	<input id="ticketId4Lab" type="hidden" value="{$ticketId}"/> 
        
</div>   
<div id="labResultLoaderDiv" style="display: none; position: fixed; top: 0px; left: 0px; height: 100%; width: 100%; z-index: 1000">
    <div style="overflow: hidden; background-color: #000; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; opacity: 0.2;">
    </div>
    <div style='padding: 6px 0px 0px 6px; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; background: #F5F5F5; border: 3px solid #CCC; margin-left: -20px; margin-top: -30px;'>
        <img src="{$base_uri}/images/ajax-loader.gif"/>
    </div>
</div> 